package main

import (
	"fmt"
	"time"
)

func server1(ch chan string) {
	time.Sleep(1 * time.Second)
	ch <- "from server1"
}

func server2(ch chan string) {
	time.Sleep(2 * time.Second)
	ch <- "from server2"
}

func main() {
	ch := make(chan string)
	go server1(ch)
	go server2(ch)
	select {
	case s1 := <-ch:
		fmt.Println(s1)
	case s2 := <-ch:
		fmt.Println(s2)
	//default:
	//	fmt.Println("no value received")
	}

	select {
	}


}
